package com.github.murzagalin.evaluator.token

sealed class Operator(name:String,argNum:Int = 2) : Token {
   data object Plus : Operator("+")
   data object Minus : Operator("-")
   data object Multiplication : Operator("*")
   data object Division : Operator("/")
   data object Modulo : Operator("%")
   data object Power : Operator("^")

   data object UnaryMinus : Operator("+",1)
   data object UnaryPlus : Operator("-",1)

   data object And : Operator("&&")
   data object Or : Operator("||")
   data object Not : Operator("!",1)

   data object BIT_And : Operator("&")
   data object BIT_Or : Operator("|")
   data object BIT_XOR : Operator("^")
   data object BIT_Not : Operator("~",1)

   data object SHIFT_LEFT: Operator("<<")
   data object SHIFT_RIGHT: Operator(">>")
   data object U_SHIFT_RIGHT: Operator(">>>")

   data object MATCH: Operator("=~", 2)


   data object GreaterThan : Operator(">") //>
   data object GreaterEqualThan : Operator(">=") //>=
   data object LessThan : Operator("<") //<
   data object LessEqualThan : Operator("<=") //<=
   data object Equal : Operator("==") //==
   data object NotEqual : Operator("!=") //!=

   data object TernaryIf : Operator("?",1)
   data object TernaryElse : Operator(":",1)
   data object TernaryIfElse : Operator("?:",1)

   companion object{
      fun contun(symbol:String):Operator?{
         return null
      }
   }
}